package com.haizhen.horizontalscrollslideview

import android.content.Intent
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.view.View
import android.widget.Toast
import android.widget.Toast.LENGTH_LONG
import com.haizhen.horizontalscrollslideview.databinding.ActivityHomeBinding
import com.haizhen.horizontalscrollslideview.databinding.ActivityMainBinding
import com.haizhen.horizontalscrollslideview.databinding.ItemRecyclerBinding
import com.haizhen.horizontalscrollslideview.databinding.ItemTestBinding

class MainActivity : AppCompatActivity() {
    private lateinit var binding: ActivityHomeBinding
    val listString= mutableListOf<String>("测试数据1","测试数据2","测试数据3","测试数据4","测试数据5","测试数据6")
    val listView= mutableListOf<View>()
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        binding = ActivityHomeBinding.inflate(layoutInflater)
        setContentView(binding.root)

        binding.textOpen.setOnClickListener {
            startActivity(Intent(this, MainActivity2::class.java))
        }


        listString.forEach{
            val itemTestBinding = ItemTestBinding.inflate(layoutInflater)
            itemTestBinding.textItem.text = it
            listView.add(itemTestBinding.root)
        }







    }
}